import request from '@/utils/request'

//  初始化表格：根据 状态 查询采购表信息并按照部门分类
export function initTable(currentMonth) {
  return request({
    url: '/materialPurchase/material-purchase/selDepMaterial',
    method: 'get',
    params: {
      preStatus: '审核中',
      currentMonth: currentMonth
    }
  })
}

//  插入新的物料采购计划
export function insertPurchase(materialName, purchaseNum, partUsed, remark, departName) {
  return request({
    url: '/materialPurchase/purchase-information/insOne',
    method: 'post',
    params: {
      materialName: materialName,
      purchaseNum: purchaseNum,
      partUsed: partUsed,
      remark: remark,
      departName: departName, // 待修改
      preStatus: '审核中'
    }
  })
}
